<ui:composition		
	  xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"      >

<ui:include src="dynamicFilter.xhtml" />

<h:form id="frmCatalogue" >
	<style>
	.ui-datatable-odd {background: none repeat scroll 0 0 #F2F5F9;}
	.ui-datatable{font-size: 12px;}	
	</style>
	
	<p:dataTable id="objetos" var="objeto" value="#{catalogueBean.objetos}" editable="true" paginator="true" paginatorPosition="bottom" rows="3" rowsPerPageTemplate="1,2,3">
		<f:facet name="header">	
			<p:commandLink action="#{catalogueBean.onCreate()}" ajax="false">
        		<h:outputText value="Nuevo/a #{catalogueBean.dynamicFilterBean.filterType}" style="color: yellow" />           					
           	</p:commandLink>
		</f:facet>
		<p:columns value="#{catalogueBean.columns}" var="column" columnIndexVar="colIndex">
			<f:facet name="header"> #{column.header} </f:facet>			
     		<h:outputText value="#{objeto[column.property]}" style="width:100%" /> 				
		</p:columns>
		<p:column style="width:100px">
    					<p:commandLink action="#{catalogueBean.onModify(objeto)}" update="frmDynamicForm" ajax="false">
           					<h:outputText value="Modify"  style="color: orange"/>           					
           				</p:commandLink>
           				<h:outputText value="     "/>
        				<p:commandLink action="#{catalogueBean.onDelete(objeto)}" update="frmDynamicForm" ajax="false">
           					<h:outputText value="Delete" style="color: orange"/>           					
           				</p:commandLink>
   		</p:column> 
	</p:dataTable>  			   

</h:form>
<ui:include src="dynamicForm.xhtml" />	

</ui:composition>